#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int ab = a * 60 + b;
  int cd = c * 60 + d;
  if (ab > cd) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}